package com.atguigu.gmall.realtime.function;

import com.atguigu.gmall.realtime.bean.SourceCt;
import org.apache.flink.table.functions.TableFunction;

/**
 * @Author lzc
 * @Date 2022/4/26 9:22
 */
public class KwProduct extends TableFunction<SourceCt> {
    
    public void eval(Long click_ct, Long order_ct, Long cart_ct) {
        if (click_ct > 0) {
            collect(new SourceCt("click", click_ct));
        }
        
        if (order_ct > 0) {
            collect(new SourceCt("order", order_ct));
        }
        
        if (cart_ct > 0) {
            collect(new SourceCt("cart", cart_ct));
        }
        
        
    }
}
